<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>数字时钟</title>
   <script>
      function toDou(n){
	     if(n<10){
		    return '0'+n;
		 }else{
		    return ''+n;
		 }
	  }
        window.onload=function(){
		   var aImg=document.getElementsByTagName("img");
		   // var str="012321";
		   function tick(){
		     var oDate=new Date();
		     var str=toDou(oDate.getHours())+toDou(oDate.getMinutes())+toDou(oDate.getSeconds()); 
		     //alert(str);
		    for(var i=0;i<aImg.length;i++){
		      aImg[i].src='images/'+str.charAt(i)+'.png';
			  //alert(aImg[i].src);
		    }}
		  setInterval(tick,1000);
		   tick();
		   
		   
		};
   </script>
</head>
<body style="background:black;color:white;font-size:50px">
  <img src="images/0.png">
  <img src="images/1.png">
  <strong style="font-size:172px">:<strong>
  <img src="images/2.png">
  <img src="images/3.png">
  <strong style="font-size:172px">:<strong>
  <img src="images/4.png">
  <img src="images/5.png">


</body>
</html>